package com.zhanglijie.theory.produceandconsume;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/8/13 0013 21:21
 */
public class ClearThread extends Thread{
    private MyQueue queue;
    public ClearThread(String name,MyQueue queue){
        super(name);
        this.queue = queue;
    }

    @Override
    public void run() {

        try{
            while (true){
                queue.clear();
                Thread.sleep(1000);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
